import { Navigate, Outlet } from 'umi'
import Cookies from "js-cookie";

const loginUrl = '/user/login'
const handleJudgeLogin = () => {
  try {
    let userInfo = (JSON.parse(Cookies.get('userInfo') as string))
    if (!userInfo.token) {
      return false
    }
  }catch {return false}
  return true
}

export default () => {
  // const isLogin = handleJudgeLogin();
  // if (isLogin) {
  //   return <Outlet />;
  // } else{
  //   console.log('检测到用户未登录，跳转到登录页面')
  //   return <Navigate to={loginUrl} />;
  // }
  console.log("@auth!!!")
}
